package io.renren.modules.efinance.vo;

import java.util.Arrays;
import java.util.Optional;

public enum AccountEnum {
    //0表示销户，1表示正常，2表示冻结
    cancellation(0,"已销户"),normal(1,"正常"),frozen(2,"冻结");
    private Integer key;
    private String status;

    public Integer getKey() {
        return key;
    }

    public String getStatus() {
        return status;
    }

    AccountEnum(Integer key, String status) { // 默认构造私有
        this.key=key;
        this.status = status;
    }
    public static String matchStatus(int stat){
        Optional<AccountEnum> first = Arrays.stream(AccountEnum.class.getEnumConstants())
                .filter(e -> e.getKey().equals(stat)).findFirst();
        return first.get().getStatus();
    }
}
